from qrcode import QRCode, constants
import colorama


def GenerateYourWifi(
    type: str, ssid: str, psswd: str, outputPath: str = None, preview: bool = True
):
    content = f"WIFI:T:{type};S:{ssid};P:{psswd};;"
    c = QRCode()
    c.add_data(content)

    if preview:
        colorama.init()
        c.make()
        c.print_tty()

    if outputPath:
        c.make_image().save(outputPath)


if __name__ == "__main__":
    ssid = ""
    psswd = ""
    GenerateYourWifi("WPA", ssid, psswd, "cz.png")
